Bookmark
xdotool - fake keyboard/mouse input, window management, and more :: semicomplete.com - Jordan Sissel
www.semicomplete.com/projects/xdotool/, posted 2010 by peter in free hack linux simulation software
This tool lets you programatically (or manually) simulate keyboard input and mouse activity, move and resize windows, etc. It does this using X11's XTEST extension and other Xlib functions.
Additionally, you can move, resize, hide, and modify window properties like the title. If your window manager supports it, you can use xdotool to switch desktops, move windows between desktops, and change the number of desktops.